<?php
/**
 * Created by PhpStorm.
 * User: pc
 * Date: 2024/3/5
 * Time: 9:52
 */

namespace app\common\service;


class ConfigTableRowDisplayRule
{
    const KEY = 'displayRule';

    const OPERATOR = 'operator';
    const VALUE = 'value';
    const FIELD = 'field';

    protected $operator;
    protected $value;
    protected $field;

    /**
     * @return mixed
     */
    public function getOperator()
    {
        return $this->operator;
    }

    /**
     * @param $operator
     * @return $this
     */
    public function setOperator($operator)
    {
        $this->operator = $operator;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getValue()
    {
        return $this->value;
    }

    /**
     * @param $value
     * @return $this
     */
    public function setValue($value)
    {
        $this->value = $value;
        return $this;
    }

    /**
     * @return mixed
     */
    public function getField()
    {
        return $this->field;
    }

    /**
     * @param $field
     * @return $this
     */
    public function setField($field)
    {
        $this->field = $field;
        return $this;
    }


    public function getRule(){
        return [
            static::OPERATOR => $this->getOperator(),
            static::VALUE => $this->getValue(),
            static::FIELD => $this->getField(),
        ];
    }
}